<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<meta name="author" content="zhupeng">
	<TITLE>空白卡片入库页面</TITLE>
	 
	<script language="javascript" src="../script/common.js" type="text/javascript"></script>
	<script language="javascript"  type="text/javascript">
		var billId;
		var billType;
		function load(){
			Eui.showNavigation();			
			setPages(["selectdetview","detview","printview"]);	
		}

		//取消方法
		 function resetFunc(){
		 	$("whiteCardOutForm").reset();
		 	switchPage('detview');
		}
		//选择卡片规格
		function selCard(){			
			var v = openDialogFrame("/store/sel_white_list.html?",'请选择卡片规格',464,700)
			if (v){
				var form=$("whiteCardOutForm")
			    form.cardSpec.value = v.id;
				form.cardSpecs.value = v.name;
			}
		}

		//保存方法
		function onSave(){
			if(!checkForm(whiteCardOutForm))return;
			if(showQuestion("您确认保存?")==true){
				var values = Common.getValues(whiteCardOutForm);
	        	DWR.call('blankCardStoreService.deliverBlankCard',values,function(v){
			  		if(v){
						showInformation("出库成功!")
						billId = v.id
						billType = CardBillType.OUT;
						requestframe.document.location.href = "print_blank_bill.html";
						switchPage("printview");
						//CardStore.showBlankBill('selectdetview',v.id);	
					}	
		      	},{disCtrl:$('saveBut')})
		   	}
		}  
		//打印方法
		function printlnBlankBill(){
			billType = CardBillType.OUT;
			requestframe.document.location.href = "print_blank_bill.html";
			switchPage("printview");
			//var v = openDialogFrame("/store/print_blank_bill.html?billType="+CardBillType.OUT+"&billId="+billId,"打印单据",450,700);
		}
		//返回方法
		function closePrintDialog(){
			whiteCardOutForm.reset();
			switchPage("detview");
		}
		
	</script>
</head>
<body onload="load()">
	<!--页面导航-->
	<div class="nav"><div id="nav">&nbsp;</div></div>
	
	<!--明细(新增)静态页面部分-->
	<div id="detview" style="">
		<form id="whiteCardOutForm" name="whiteCardOutForm">
			<input type="hidden" name="cardSpec">
			<div class="form">
			<div class="formTitle">白卡出库</div>
				<table cellSpacing=0 cellPadding=4 width="100%" border=0 class="col2">
					<tr>
						<td><label>卡片规格</label> <input type="text" name="cardSpecs" readonly class="readonly" onblur="checkV(this,'',true)" ><a class="orga" title="选择卡片规格" href="javascript:void(0)" onclick="selCard()">&nbsp;&nbsp;</a><span class="des">*</span></td>   
						<td><label>数&nbsp;&nbsp;&nbsp;&nbsp;量</label> <input type="text" name="amount"  maxlength="9" onblur="checkV(this,'positiveInt',true)" ><span class="des">*</span></td>   
					</tr>
					<tr>
						<td><label>备&nbsp;&nbsp;&nbsp;&nbsp;注</label> <input type="text" name="description"  maxlength="32"></td> 
					</tr>
				</table>
			</div>
			<p><button type="button" id="saveBut"  onclick="onSave()" >保 存</button></p>
		</form>
	</div>
	<div id="selectdetview" style="display:none;" align="center"></div>
	
	<div class="printview" id="printview" style='display:none;'>
		<iframe id="requestframe" name="requestframe" style="width:100%;height:90%;overflow:auto;" frameborder=0 src=""></iframe>
	</div>
</body>
</html>
